by Devin Yang
(This article was automatically translated.)

Published - 7 years ago ( Updated - 7 years ago )

Forcibly clear all the data of the remote repo and generate a new repo,
Be aware this is a dangerous move , know you know what you are doing.

git init
git add .
git commit -m 'Initial commit'
git remote add origin [repo_address]
git push --mirror --force

Tags: git

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


docker,git

Use docker-compose to quickly build a private git service

How to quickly set up an out-of-the-box Gogs environment? This article introduces the use of docker-compose.yml to quickly establish a gogs environment.

git

How do I delete a remote branch on my GitHub

How do I delete my remote branch on GitHub. First of all, you can use the command to view the origin git remote -v At this time, it may display as follows: origin https://github.com/DevinY/dlaravel.git (fetch) ​​​​​​​​origin https://github.com/DevinY/dlaravel.git (push)

git

Yesterday's report of git alias

We can use git config --global alias.[alias] to "reduce the long and long git subcommands that are often executed" into simplified aliases. So you can also add your frequently used git commands to the global git alias through the git alias setting. Let's take a look at my practical example of how to reduce long subcommands into easy-to-use aliases.